<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Users</title>
</head>
<body>
<h1>用户管理</h1>
<hr>
<div th:include="commons/topBar :: topBar"></div>

<h3><a th:href="@{/user/toAddUser}">增加用户</a></h3>
<table border="1">
    <tr>
        <th>编号</th>
        <th>用户名</th>
        <th>角色</th>
        <th>注册时间</th>
        <th>登陆次数</th>
        <th>操作</th>
    </tr>
    <tr th:each="user, userIndex : ${userList}" th:if="${user.role == 0}">
        <td th:text="${userIndex.index + 1}"></td>
        <td th:text="${user.username}"></td>
        <td th:text="${user.role}"></td>
        <td th:text="${#dates.format(user.regtime, 'yyyy-MM-dd HH:mm:ss')}"></td>
        <td th:text="${user.lognum}"></td>
        <td>
            <a th:href="@{/user/toUpdateUser/{username}(username = ${user.username})}">编辑</a>
            <a th:href="@{/user/deleteUser/{username}(username = ${user.username})}">删除</a>
        </td>
    </tr>
</table>
</body>
</html>